package view;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;

import controller.Sistema;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class BajaPlanBase extends javax.swing.JFrame {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private BajaPlanBase instancia; 
	private JButton Cancelar;
	private JButton Aceptar;
	private JTextField NumeroPlantxt;
	private JLabel NumeroPlan;
	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				BajaPlanAdicional inst = new BajaPlanAdicional();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public BajaPlanBase() {
		super();
		initGUI();
		instancia= this;
		this.setTitle("Baja Plan Base");
		{
			NumeroPlan = new JLabel();
			getContentPane().add(NumeroPlan);
			NumeroPlan.setText("Numero Plan");
			NumeroPlan.setBounds(38, 32, 118, 16);
		}
		{
			NumeroPlantxt = new JTextField();
			getContentPane().add(NumeroPlantxt);
			NumeroPlantxt.setBounds(168, 29, 163, 23);
		}
		{
			Aceptar = new JButton();
			getContentPane().add(Aceptar);
			Aceptar.setText("Aceptar");
			Aceptar.setBounds(71, 87, 80, 23);
			Aceptar.addActionListener(new ActionListener() {
				
				@Override
				public void actionPerformed(ActionEvent arg0) {
					Sistema.getInstance().bajaPlanBase(NumeroPlantxt.getText());
					limpiarCampos();
				}
			});
		}
		{
			Cancelar = new JButton();
			getContentPane().add(Cancelar);
			Cancelar.setText("Cancelar");
			Cancelar.setBounds(181, 87, 88, 23);
			Cancelar.addActionListener(new ActionListener() {
				
				@Override
				public void actionPerformed(ActionEvent arg0) {
					Menu app = new Menu();
					app.setLocationRelativeTo(null);
					app.setVisible(true);
					instancia.dispose();
				}
			});
		}
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setLayout(null);
			pack();
			this.setSize(399, 181);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	private void limpiarCampos() {
		NumeroPlantxt.setText("");

		
	}

}